/*****************************************************************************
    COPYRIGHT (C) 2000, Ken Bertelson <kenbertelson@hotmail.com>


*****************************************************************************/

#if !defined(AFX_DATAVSAME_H__51055662_F9EE_11D3_B765_00C04F6A7AE6__INCLUDED_)
#define AFX_DATAVSAME_H__51055662_F9EE_11D3_B765_00C04F6A7AE6__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "GridCell.h"
class CGridTreeCtrlDemoDlg;

class CDataVSame  
{
public:
	CDataVSame();
	virtual ~CDataVSame();

    void SetGridTreeCtrlDemoDlg( CGridTreeCtrlDemoDlg* pGridTreeCtrlDemoDlg)
        { m_pGridTreeCtrlDemoDlg = pGridTreeCtrlDemoDlg; }

// Attributes
public:
    virtual void SetFormat(int nRow, int nCol, DWORD nFormat);
    virtual void SetImage(int /* nRow */, int /* nCol */, int nImage)       { m_nImage = nImage; }
    virtual void SetData(int /* nRow */, int /* nCol */, LPARAM lParam)     { m_lParam = lParam; }
    virtual void SetTextClr(int /* nRow */, int /* nCol */, COLORREF clr)   { m_crFgClr = clr; }
    virtual void SetBackClr(int /* nRow */, int /* nCol */, COLORREF clr)   { m_crBkClr = clr; }
    virtual void SetFont(int /* nRow */, int /* nCol */, const LOGFONT* plf){ memcpy(&(m_lfFont), plf, sizeof(LOGFONT)); }
    virtual void SetMargin(int /* nRow */, int /* nCol */, UINT nMargin)    { m_nMargin = nMargin; }
    virtual void SetGrid(CGridCtrl* /* pGrid */)                                  { ASSERT( m_pGridTreeCtrlDemoDlg); }

    virtual LPCTSTR  GetText(int nRow, int nCol);
    virtual int      GetImage(int /* nRow */, int /* nCol */)               { return m_nImage; }
    virtual LPARAM   GetData(int /* nRow */, int /* nCol */)                { return m_lParam; }

    virtual DWORD    GetFormat(int nRow, int nCol)    
        { 
            if( nRow == 0)
                return m_nFormatRowZero;
            else if( nCol == 0) 
                return m_nFormatColZero; 
            return m_nFormat;
        }
    virtual COLORREF GetTextClr(int /* nRow */, int /* nCol */)   { return m_crFgClr; }
    virtual COLORREF GetBackClr(int /* nRow */, int /* nCol */)   { return m_crBkClr; }
    virtual const LOGFONT* GetFont(int /* nRow */, int /* nCol */)      { return &m_lfFont; }
    virtual UINT     GetMargin(int /* nRow */, int /* nCol */)    { return m_nMargin; }
    virtual CGridCtrl* GetGrid()                                  { return (CGridCtrl*)m_pGridTreeCtrlDemoDlg; }

protected:
    DWORD    m_nFormat;     // Cell format
    DWORD    m_nFormatColZero;   // for row and column headings
    DWORD    m_nFormatRowZero;
    int      m_nImage;
    LPARAM   m_lParam;

    COLORREF m_crBkClr;     // Background colour (or CLR_DEFAULT)
    COLORREF m_crFgClr;     // Forground colour (or CLR_DEFAULT)
    LOGFONT  m_lfFont;      // Cell font
    UINT     m_nMargin;     // Internal cell margin

    CGridTreeCtrlDemoDlg* m_pGridTreeCtrlDemoDlg;   // key to virtual grid text info
};

#endif // !defined(AFX_DATAVSAME_H__51055662_F9EE_11D3_B765_00C04F6A7AE6__INCLUDED_)
